<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <body>
        <ui:composition>
            <ui:insert name="barcss">
                <h:outputStylesheet library="css" name="bar/bar.css"></h:outputStylesheet>
                <h:outputStylesheet library="css" name="bar/bar_desktop.css" media="screen and (min-width:1025px) and (max-width:1600px)"></h:outputStylesheet>
                <h:outputStylesheet library="css" name="bar/bar_desktop_wide.css" media="screen and (min-width : 1601px)"></h:outputStylesheet>
                <h:outputStylesheet library="css" name="bar/bar_tablet.css" media="screen and (min-device-width : 768px) and (max-device-width : 1024px), screen and (max-width:1024px)"></h:outputStylesheet>
                <h:outputStylesheet library="css" name="bar/bar_smartphone.css" media="screen and (min-device-width : 320px) and (max-device-width : 767px), screen and (max-width:767px)"></h:outputStylesheet>
            </ui:insert>
            <p:dialog draggable="false" resizable="false" header="#{indexMessages.Login}" position="top" modal="true" widgetVar="loginDialog" id="loginDialog">
                <h:form id="barDialogLoginForm">
                    <p:inputText styleClass="loginEmail" id="loginEmail" value="#{loginBean.email}" required="true" requiredMessage="#{messages.EmailRequired}" label="#{messages.Email}">  
                        <f:validator  binding="#{loginEmailValidator}"></f:validator>
                        <p:ajax event="change" update=":barForm:growl" />
                    </p:inputText> 
                    <p:watermark for="loginEmail" value="#{messages.Email}" /> 
                    <p:password style="margin-bottom: 1em!important" styleClass="loginPassword" id="loginPassword" value="#{loginBean.password}" required="true" requiredMessage="#{messages.PasswordRequired}" label="#{messages.Password}">
                        <f:validateLength minimum="5" maximum="30"></f:validateLength>
                        <p:watermark for="loginPassword" value="#{messages.Password}" />
                    </p:password>
                    <p:commandButton style="margin-bottom: 1em;margin-left: 0.3em;" styleClass="landingButton loginLandingButton blueBackgroundStrong" process="@parent" value="#{messages.LogIn}" update=":barForm:growl" id="ajax" action="#{loginBean.logIn}" />
                    <p:commandLink process="@this" oncomplete="PF('loginDialog').hide();PF('passwordRecoveryDialog').show();" actionListener="#{recoveryPasswordBean.reinitEmail()}" styleClass="forgot" value="#{messages.ForgotPassword}"></p:commandLink>
                </h:form>
            </p:dialog>
                
            <p:dialog draggable="false" resizable="false" header="#{indexMessages.Register}" modal="true" widgetVar="registerDialog" position="top" id="registerDialog">
                <h:form id="barDialogRegisterForm">
                    <p:inputText styleClass="loginInput" id="email" value="#{createCandidateBean.candidate.user.email}" required="true" requiredMessage="#{messages.EmailRequired}" label="#{messages.Email}">  
                        <f:validator  binding="#{emailValidator}"></f:validator>
                        <p:ajax event="change" update=":barForm:growl" />
                    </p:inputText>  
                    <p:watermark for="email" value="#{messages.Email}" /> 

                    <p:password styleClass="loginInput" id="password" match="password2" feedback="true" value="#{createCandidateBean.candidate.user.password}" required="true" requiredMessage="#{messages.PasswordRequired}" label="#{messages.Password}">
                        <f:validateLength minimum="5" maximum="30"></f:validateLength>
                    </p:password>
                    <p:watermark for="password" value="#{messages.Password}" />

                    <p:password style="margin-bottom: 1em;" styleClass="loginInput" id="password2" feedback="true" value="#{createCandidateBean.candidate.user.password}" required="true" requiredMessage="#{messages.RepeatPasswordRequired}" label="#{messages.RepeatPassword}">
                    </p:password>
                    <p:watermark for="password2" value="#{messages.RepeatPassword}" />
                    <div class="floatRight contractDiv">
                        <h:outputText styleClass="contractMessage" value="#{messages.ContractAccept} "></h:outputText>
                        <p:commandLink styleClass="contractMessage contractLink" value="#{messages.UseTerms} " process="@this" action="/views/recruit/UseTerms?faces-redirect=true"></p:commandLink>
                        <h:outputText styleClass="contractMessage" value="#{messages.And} "></h:outputText>
                        <p:commandLink styleClass="contractMessage contractLink" value="#{messages.PrivacyPolicy}" process="@this" action="/views/recruit/Privacy?faces-redirect=true"></p:commandLink>
                    </div>    
                    <p:commandButton process="@parent" style="margin-bottom: 1em;margin-left: 0.3em;" styleClass="landingButton loginLandingButton redBackgroundStrong" value="#{indexMessages.Register}" update=":barForm:growl" action="#{createCandidateBean.createCandidate}" />  
                </h:form>
            </p:dialog>

            <p:dialog draggable="false" resizable="false" id="passwordRecoveryDialog" position="top" widgetVar="passwordRecoveryDialog" header="#{messages.ForgotPassword}" modal="true">
                <p:panelGrid styleClass="noBorder noPadding noMargin" columns="1">
                    <h:form id="barDialogRecoveryForm">
                        <p:inputText id="recoveryEmail" value="#{recoveryPasswordBean.email}">
                            <f:validator  binding="#{loginEmailValidator}"></f:validator>
                            <p:ajax event="change" update=":barForm:growl" />
                        </p:inputText>
                        <p:watermark for="recoveryEmail" value="#{messages.Email}" />
                        <p:captcha label="Captcha" theme="white"></p:captcha>
                        <p:commandButton process="@parent" styleClass="grayBackgroundStrong" update=":barForm:growl" value="#{messages.Recover}" actionListener="#{recoveryPasswordBean.createRecovery()}"></p:commandButton>
                    </h:form>
                </p:panelGrid>
            </p:dialog>            
            
            <h:form id="barForm">
                <p:growl id="growl" showDetail="false" autoUpdate="true" />
                <div id="bar" class="homeBar fixed">
                    <p:commandLink process="@this" styleClass=" logo" action="#{loginBean.goIndex()}">
                        <h:graphicImage library="images" style="width:100%" alt="#{indexMessages.LogoAlt}" name="logo.png"></h:graphicImage>
                    </p:commandLink>
                    <span class="ui-button-text menuButton floatRight displayNone smartphone bodyFont inlineBlock">#{indexMessages.Menu}</span>
                    <div id="navBar" class="overflowHidden height0 textAlignRight">
                        <ul class="barMenu">
                            <li class="barMenuItem bodyFont textAlignRight">
                                <h:outputLink styleClass="ui-button-text" value="http://blog.therecruitery.com/?utm_source=web&amp;utm_medium=web.&amp;utm_campaign=visita%20el%20blog" onclick="_gaq.push(['_link','http://blog.therecruitery.com']); return false;" >#{messages.Blog}</h:outputLink>
                            </li>
                            <li class="barMenuItem bodyFont textAlignRight">
                                <p:commandLink process="@this" update=":suggestionsForm:suggestionsDialog" styleClass="noSmartphone ui-button-text" oncomplete="PF('suggestionsDialog').show();" value="#{messages.Contact}"></p:commandLink>
                                <p:commandLink process="@this" styleClass="ui-button-text displayNone smartphone" action="/views/smartphone/Suggestions?faces-redirect=true" value="#{messages.Contact}"></p:commandLink>
                            </li>
                            <li class="barMenuItem bodyFont textAlignRight">
                                <p:commandLink process="@this" styleClass="noSmartphone ui-button-text" onclick="PF('loginDialog').show();" value="#{indexMessages.Login}"></p:commandLink>
                                <p:commandLink process="@this" styleClass="ui-button-text displayNone smartphone" action="/views/smartphone/Login?faces-redirect=true" value="#{indexMessages.Login}"></p:commandLink>
                            </li>
                            <li class="barMenuItem textAlignRight">
                                <p:commandLink process="@this" styleClass="noSmartphone ui-button-text" onclick="PF('registerDialog').show();" value="#{indexMessages.Register}"></p:commandLink>
                                <p:commandLink process="@this" styleClass="ui-button-text displayNone smartphone" action="/views/smartphone/Register?faces-redirect=true" value="#{indexMessages.Register}"></p:commandLink>
                            </li>
                             <li class="barMenuItem bodyFont textAlignRight">
                                <p:commandLink process="@this" styleClass="ui-button-text" action="/company?faces-redirect=true" value="#{indexMessages.Companies}"></p:commandLink>
                            </li>
                        </ul>
                    </div>
                </div>
            </h:form>
            <h:outputScript library="javascript" name="bar.js"></h:outputScript>
        </ui:composition>
    </body>
</html>

